<!--  -->
<template>
  <div class>
    <div class="tit-box">
      <h2>
        <i class="el-icon-s-unfold icon-add"></i>
        <i>列表员工</i>
      </h2>
      <span class="but-z">
        <i class="el-icon-circle-plus icon-add"></i>
        <i>新增员工</i>
      </span>
    </div>
    <div class="nav-tit">
      <div class="itme1"></div>
      <div class="itme2">工号</div>
      <div class="itme3">姓名</div>
      <div class="itme4">会员手机</div>
      <div class="itme5">角色</div>
      <div class="itme6">添加时间</div>
      <div class="itme7">禁用账户</div>
      <div class="itme8">操作</div>
    </div>
    <div class="nav-box">
      <div class="nav-line" v-for="(itme) in listnav" :key="itme.id">
        <div class="itmes1">
          <input type="checkbox" :checked="valbox" />
        </div>
        <div class="itmes2">{{itme.id}}</div>
        <div class="itmes3">{{itme.name}}</div>
        <div class="itmes4">{{itme.phone}}</div>
        <div class="itmes5">{{itme.admin}}</div>
        <div class="itmes6">{{itme.mtime}}</div>
        <div class="itmes7">
            <el-switch v-model="itme.isva" active-color="#9137f3" inactive-color="#e9ebef"></el-switch>
        </div>
        <div class="itmes8">
          <span>编辑</span>
          <span @click="delefd">删除</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  props: ["tileaa"],
  data() {
    //这里存放数据
    return {
      listnav: [
        {
          id: 20190301021,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301022,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301023,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301024,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301025,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301026,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301027,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301028,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301029,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
        {
          id: 20190301030,
          name: "John",
          phone: 18854138769,
          admin: "管理员",
          mtime: "2019-01-25 10:55",
          isva: false,
        },
      ],
      value: "ture",
    };
  },
  //监听属性 类似于data概念
  computed: {
    valbox: function () {
      return this.tileaa;
    },
    hub() {
      this.listnav.forEach((element, index) => {
        element.isva = this.tileaa;
      });
      return 1;
    },
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  props: ["tileaa"],
  methods: {
    delefd() {
      this.$notify({
        title: "成功",
        message: "删除成功",
        type: "success",
      });
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style  scoped>
i {
  font-style: normal;
  padding: 0 4px;
}
h2 {
  font-size: 14px;
  font-weight: normal;
  color: #555;
  line-height: 30px;
}
.tit-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.but-z {
  width: 94px;
  height: 30px;
  border: 1px solid #9137f3;
  color: #9137f3;
  border-radius: 4px;
  line-height: 28px;
  font-size: 12px;
  padding-left: 4px;
}
.icon-add {
  font-size: 18px;
  position: relative;
  left: 5px;
  top: 2px;
}
.nav-tit {
  height: 60px;
  background: #9137f3;
  display: flex;
}
.nav-tit > div {
  text-align: center;
  line-height: 60px;
  color: #fff;
}
.itme1 {
  width: 80px;
}
.itme2 {
  width: 114px;
}
.itme3 {
  width: 160px;
}
.itme4 {
  width: 173px;
}
.itme5 {
  width: 125px;
}
.itme6 {
  width: 123px;
}
.itme7 {
  width: 121px;
}
.itme8 {
  width: 140px;
}
.itmes1 {
  width: 80px;
}
.itmes2 {
  width: 118px;
}
.itmes3 {
  width: 166px;
}
.itmes4 {
  width: 180px;
}
.itmes5 {
  width: 130px;
}
.itmes6 {
  width: 118px;
}
.itmes7 {
  width: 106px;
}
.itmes8 {
  display: flex;
  width: 144px;
  justify-content: space-around;
  color: #9137f3;
  cursor: pointer;
}
.nav-line {
  display: flex;
  text-align: center;
  line-height: 90px;
  font-size: 12px;
  height: 89px;
  border-bottom: 1px solid #ccc;
}
</style>
<style>
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #9137f3;
  font-size: 12px;
  font-weight: normal;
  color: #fff;
}
</style>